<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>flex学习，骰子布局</title>
    <style>

        .box-1 {
            display: flex; /*将容器指定为flex容器*/
            justify-content: center; /*定义了项目在主轴上的对齐方式*/
        }

        .box-2 {
            display: flex;
            justify-content: flex-end;
        }

        .box-3 {
            display: flex;
            align-items: center; /*设置交叉轴的对齐方式*/
        }

        .box-4 {
            display: flex;
            justify-content: center; /*主轴对齐方式*/
            align-items: center; /*交叉轴对齐方式*/
        }

        .box-5 {
            display: flex;
            justify-content: center;
            align-items: flex-end;
        }

        .box-6 {
            display: flex;
            justify-content: flex-end;
            align-items: flex-end;
        }

        .box-7 {
            display: flex;
            justify-content: space-between; /*space-between:两端对齐，项目之间的间隔都相等*/
        }

        .box-8 {
            display: flex;
            flex-direction: column; /*决定主轴方向*/
            justify-content: space-between;
        }

        .box-9 {
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            align-items: center;
        }

        .box-10 {
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            align-items: flex-end;
        }

        .box-11 {
            display: flex;
        }

        .box-11 .item:nth-child(2) {
            align-self: center;
        }

        .box-12 {
            display: flex;
            justify-content: space-between;
        }

        .box-12 .item:nth-child(2) {
            align-self: flex-end;
        }

        .box-13 {
            display: flex;
        }

        .box-13 .item:nth-child(2) {
            align-self: center;
        }

        .box-13 .item:nth-child(3) {
            align-self: flex-end;
        }

        .box-14 {
            display: flex;
            flex-wrap: wrap; /*改属性定义，如果一条轴线排不下，如何换行*/
            justify-content: flex-end;
            align-content: space-between; /*该属性定义了多跟轴线的对齐方式,轴线与轴线的距离*/
        }

        .box-15 {
            display: flex;
            flex-wrap: wrap;
            align-content: space-between;
        }

        .column {
            flex-basis: 100%; /*属性定义了再分配多余空间之前，项目占据的主轴空间（main size）.浏览器根据这个属性，计算主轴是否有多余空间*/
            display: flex;
            justify-content: space-between;
        }

        .box-16 {
            display: flex;
            flex-wrap: wrap;
            align-content: space-between;
        }

        .box-17 {
            display: flex;
            flex-direction: column;
            flex-wrap: wrap;
            align-content: space-between;
        }

        .box-18 {
            display: flex;
            flex-wrap: wrap;
        }

        .box-19 {
            display: flex;
            flex-wrap: wrap;
        }

        .row {
            flex-basis: 100%;
            display: flex;
        }

        .row:nth-child(2) {
            justify-content: center;
        }

        .row:nth-child(3) {
            justify-content: space-between;
        }

        .item {
            display: block;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            margin: 4px;

            background-color: #333;
            box-shadow: inset 0 3px #111, inset 0 -3px #555;
        }

        .main {
            margin: 16px;
            padding: 4px;

            background-color: #e7e7e7;
            width: 104px;
            height: 104px;
            object-fit: contain;

            box-shadow: inset 0 5px white,
            inset 0 -5px #bbb,
            inset 5px 0 #d7d7d7,
            inset -5px 0 #d7d7d7;

            border-radius: 10%;
        }

    </style>
</head>
<body>
<div class="box-1 main">
    <span class="item"></span>
</div>

<div class="box-2 main">
    <span class="item"></span>
</div>

<div class="box-3 main">
    <span class="item"></span>
</div>

<div class="box-4 main">
    <span class="item"></span>
</div>

<div class="box-5 main">
    <span class="item"></span>
</div>

<div class="box-6 main">
    <span class="item"></span>
</div>

<div class="box-7 main">
    <span class="item"></span>
    <span class="item"></span>
</div>

<div class="box-8 main">
    <span class="item"></span>
    <span class="item"></span>
</div>

<div class="box-9 main">
    <span class="item"></span>
    <span class="item"></span>
</div>

<div class="box-10 main">
    <span class="item"></span>
    <span class="item"></span>
</div>

<div class="box-11 main">
    <span class="item"></span>
    <span class="item"></span>
</div>

<div class="box-12 main">
    <span class="item"></span>
    <span class="item"></span>
</div>

<div class="box-13 main">
    <span class="item"></span>
    <span class="item"></span>
    <span class="item"></span>
</div>

<div class="box-14 main">
    <span class="item"></span>
    <span class="item"></span>
    <span class="item"></span>
    <span class="item"></span>
</div>

<div class="box-15 main">
    <div class="column">
        <span class="item"></span>
        <span class="item"></span>
    </div>
    <div class="column">
        <span class="item"></span>
        <span class="item"></span>
    </div>
</div>

<div class="box-16 main">
    <span class="item"></span>
    <span class="item"></span>
    <span class="item"></span>
    <span class="item"></span>
    <span class="item"></span>
    <span class="item"></span>
</div>

<div class="box-17 main">
    <span class="item"></span>
    <span class="item"></span>
    <span class="item"></span>
    <span class="item"></span>
    <span class="item"></span>
    <span class="item"></span>
</div>

<div class="box-18 main">
    <div class="row">
        <span class="item"></span>
        <span class="item"></span>
        <span class="item"></span>
    </div>
    <div class="row">
        <span class="item"></span>
    </div>
    <div class="row">
        <span class="item"></span>
        <span class="item"></span>
    </div>
</div>

<div class="box-19 main">
    <span class="item"></span>
    <span class="item"></span>
    <span class="item"></span>
    <span class="item"></span>
    <span class="item"></span>
    <span class="item"></span>
    <span class="item"></span>
    <span class="item"></span>
    <span class="item"></span>
</div>

</body>
</html>